<script lang="ts" setup>

import { onMounted, ref, onBeforeMount } from 'vue';

import { Search } from '@element-plus/icons-vue'
const tableData = [
  {
    date: '2016-05-03',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
  },
  {
    date: '2016-05-02',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
  },
  {
    date: '2016-05-04',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
  },
  {
    date: '2016-05-08',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
  },
  {
    date: '2016-05-06',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
  },
  {
    date: '2016-05-07',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
  },
]
const input2 = ref('')
const currentPage2 = ref(5)
const pageSize2 = ref(100)
const size = ref(10)
const background = ref(false)

const handleSizeChange = (val: number) => {
  console.log(`${val} items per page`)
}
const handleCurrentChange = (val: number) => {
  console.log(`current page: ${val}`)
}
const active = ref('0')
const changeAct = (val: any) => {
  active.value = val
}
const testAct = ref('0')
const changeTest = (val: any) => {
  testAct.value = val
}

</script>
<template>
  <div class="container1 container ">
    <div class="userbox">
      <div class="user_l">
        <img src="" class="useravatar" alt="">
        <div>
          <div style="display: flex;align-items: flex-end;">
            <p>赵彦秋</p> 主任医师
          </div>
          <span>河南省肿瘤医院</span>
          <div class="tag">三甲</div>
        </div>
      </div>
      <div class="user_r">
        非小细胞肺癌、实体瘤、小细胞肺癌、肿瘤、肺癌、间皮瘤、骨转移、骨肉瘤
      </div>
    </div>
    <div class="contentbox">
      <div class="searchHeader">
        <el-input style="width: 300px;" v-model="input2" class="input" placeholder="请输入试验名称、申办者、要求搜索">
          <template #suffix>
            <el-icon style="color: #0C9397;">
              <Search />
            </el-icon>
          </template>
        </el-input> <el-input style="width: 300px;" v-model="input2" class="input" placeholder="请输入试验名称、申办者、要求搜索">
          <template #suffix>
            <el-icon style="color: #0C9397;">
              <Search />
            </el-icon>
          </template>
        </el-input>
        <el-input style="width: 300px;" v-model="input2" class="input" placeholder="请输入试验名称、申办者、要求搜索">
          <template #suffix>
            <el-icon style="color: #0C9397;">
              <Search />
            </el-icon>
          </template>
        </el-input>
        <div>
          研究者数目：3102
          <button class="export">导出</button>
        </div>
      </div>
      <el-table class="testTable" :data="tableData" align="left" header-row-class-name="headerName" :border="false"
        style="width: 100%">
        <el-table-column type="expand">
          <template #default="props">
            <div class="expandData">
              <p>登记号:CTR20244572 </p>
              <p>试验分类:药代动力学/药效动力学试验</p>

            </div>
          </template>
        </el-table-column>

        <el-table-column prop="date" label="试验名称" width="300">
          <template #default="scope">
            <p style="color: #0C9397;">试验分类:药代动力学/药效动力学试验</p>

          </template>
        </el-table-column>
        <el-table-column prop="date" label="适应症" />
        <el-table-column prop="date" label="研究中心" />
        <el-table-column prop="date" label="主要研究者" />

        <el-table-column prop="date" label="申办方" />

        <el-table-column prop="date" label="分期" width="180">
          <template #default="scope">
            <!-- <el-button size="mini" style="color: #0C9397;" link> 合作咨询 </el-button> -->
          </template>
        </el-table-column>
      </el-table>
      <div class="pagination">
        <el-pagination v-model:current-page="currentPage2" v-model:page-size="pageSize2"
          :page-sizes="[10, 200, 300, 400]" :size="size" :background="true" layout="prev, pager, next,sizes,"
          :total="1000" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
      </div>


    </div>
  </div>

</template>
<style scoped lang="scss">
.container {
  // background-color: #fff;
  height: calc(100% - 40px);
  margin: 20px auto;
}

button {
  width: 120px;
  height: 36px;
  background-color: #F5F5F5;
  font-size: 16px;
  margin-right: 11px;
  cursor: pointer;
  color: #333333;
}

.on {
  background-color: #0C9397;
  color: #fff;
}

.searchHeader {
  display: flex;
  margin-bottom: 13px;

  .input {
  margin-right: 13px;    
  }

  div {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  .export{
    width: 70px;
height: 34px;

    color: #fff;
    background-color:#0C9397;
    margin: 0 0 0 10px;
  }
}

.pagination {
  margin-top: 30px;
  display: flex;
  justify-content: flex-end;
}

.openTest {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 20px;

  button {
    margin: 0;
    border: 1px solid #0C9397;
    color: #0C9397;
    background-color: rgba(12, 147, 151, .1);
  }

  span {
    margin-right: 12px;
    color: #666;
  }

  .teston {
    background-color: #0C9397;
    color: #fff;
  }
}

.expandData {
  background: #F5F5F5;
  margin: 10px 20px;

  p {
    font-size: 16px;
    color: #666666;
    margin-top: 10px;
  }
}

.userbox {
  background-color: #fff;
  padding: 25px 20px;
  display: flex;
  height: 160px;
  .user_l {
    display: flex;
    line-height: 1;

    img {
      width: 88px;
      height: 88px;
      border-radius: 50%;
      margin-right: 15px;
    }

    font-size: 15px;
    color: #333333;

    p {
      font-size: 20px;
      color: #111111;
    }

    span {
      color: #999999;
      margin: 14px 0 10px;
      display: inline-block;
    }

    .tag {
      width: 44px;
      height: 22px;
      background: #0C9397;
      border-radius: 3px;
      font-size: 14px;
      color: #fff;
      text-align: center;
      line-height: 22px;
    }
  }
  .user_r{
    position: relative;
    margin-left: 150px;
  }
  .user_r::before{
    position: absolute;
    clear: both;
    content: '';
    height: 106px;
    width: 1px;
    background-color: #f5f5f5;
    left: -75px;
    top:0;
  }
}
.contentbox{
    background-color: #fff;
    padding: 20px;
    margin-top: 20px;
}
</style>